﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:system="clr-namespace:System;assembly=mscorlib">
    <Style TargetType="TabItem">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabItem">
                    <Border x:Name="rightBorder"
                        BorderThickness="0">
                        <Border x:Name="leftBorder"
                            BorderThickness="0,0,0,0">
                            <TextBlock x:Name="ContentSite"
                                            Text="{TemplateBinding Header}"
                                            HorizontalAlignment="Stretch"
                                            Margin="20,4,20,5"
                                            VerticalAlignment="Center"
                                            FontSize="14"
                                            Foreground="{TemplateBinding Foreground}"/>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="rightBorder"
                                Property="BorderBrush"
                                Value="{DynamicResource ColorThemeBrush}" />
                            <Setter TargetName="rightBorder"
                                Property="BorderThickness"
                                Value="0,0,0,2" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="TabControl">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabControl">
                    <Grid KeyboardNavigation.TabNavigation="Local" ShowGridLines="False">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid Name="Header"
                            Background="Transparent"
                            Grid.Column="0"
                            Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Border Background="{x:Null}"
                                BorderBrush="{x:Null}"
                                BorderThickness="1,1,0,1"
                                CornerRadius="0"
                                Grid.Column="1"
                                Grid.Row="0"
                                KeyboardNavigation.TabIndex="1"
                                Margin="6"
                                Panel.ZIndex="1">
                                <StackPanel Name="HeaderPanel"
                                        IsItemsHost="True"
                                        Orientation="Horizontal">
                                </StackPanel>
                            </Border>
                        </Grid>
                        <ContentPresenter Grid.Row="1" ContentSource="SelectedContent" Margin="5"
                                        KeyboardNavigation.DirectionalNavigation="Contained"
                                        KeyboardNavigation.TabIndex="2"
                                        KeyboardNavigation.TabNavigation="Local" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
